<?php

declare(strict_types=1);

namespace Moon\Server;


use Moon\Server\ServerConfig;
use Psr\Container\ContainerInterface;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;

interface ServerInterface
{
    const SERVER_HTTP = 1;

    const SERVER_WEBSOCKET = 2;

    const SERVER_BASE = 3;

    /**
     * @deprecated v1.1
     */
    const SERVER_TCP = self::SERVER_BASE;

    public function __construct(ContainerInterface $container, LoggerInterface $logger, EventDispatcherInterface $dispatcher);

    public function init(ServerConfig $config): \Hyperf\Server\ServerInterface;

    public function start();

    public function getServer(): \Swoole\Server;
}